home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / dev / misc / libx11.lha / libX11 / cursors.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-22  |  16.1 KB  |  625 lines

  1. /* Copyright (c) 1996 by Terje Pedersen.  All Rights Reserved   */
  2. /*                                                              */
  3. /* By using this code you will agree to these terms:            */
  4. /*                                                              */
  5. /* 1. You may not use this code for profit in any way or form   */
  6. /*    unless an agreement with the author has been reached.     */
  7. /*                                                              */
  8. /* 2. The author is not responsible for any damages caused by   */
  9. /*    the use of this code.                                     */
  10. /*                                                              */
  11. /* 3. All modifications are to be released to the public.       */
  12. /*                                                              */
  13. /* Thats it! Have fun!                                          */
  14. /* TP                                                           */
  15. /*                                                              */
  16.  
  17. /***
  18.    NAME
  19.      cursors
  20.    PURPOSE
  21.      
  22.    NOTES
  23.      
  24.    HISTORY
  25.      Terje Pedersen - Jan 22, 1995: Created.
  26. ***/
  27.  
  28.  
  29. #include <stdio.h>
  30.  
  31. #include <intuition/intuition.h>
  32. #include <intuition/pointerclass.h>
  33. #include <graphics/videocontrol.h>
  34. #include <proto/intuition.h>
  35.  
  36. #include <stdlib.h>
  37. #include <string.h>
  38.  
  39. #include "libX11.h"
  40.  
  41. #define DEBUGXEMUL_WARNING 1
  42.  
  43. #include <X11/X.h>
  44. #include <X11/Xlib.h>
  45.  
  46. #include <libraries/mui.h>
  47. #include <proto/muimaster.h>
  48.  
  49. UWORD DXC_ul_angle [16] = { 
  50.     0x0000,
  51.     0x7fe0,
  52.     0x7fe0,
  53.     0x6000,
  54.     0x6000,
  55.     0x6000,
  56.     0x6000,
  57.     0x6000,
  58.     0x6000,
  59.     0x6000,
  60.     0x6000,
  61.     0x0000,
  62.     0x0000,
  63.     0x0000,
  64.     0x0000,
  65.     0x0000,
  66.     };
  67.  
  68. UWORD DXC_right_ptr [16] = { 
  69.     0x0000,
  70.     0x0080,
  71.     0x0180,
  72.     0x0380,
  73.     0x0780,
  74.     0x0f80,
  75.     0x1f80,
  76.     0x3f80,
  77.     0x7f80,
  78.     0x0f80,
  79.     0x0d80,
  80.     0x1880,
  81.     0x1800,
  82.     0x3000,
  83.     0x3000,
  84.     0x0000,
  85.     };
  86.  
  87. UWORD DXC_arrow [16] = { 
  88.     0x0000,
  89.     0x0006,
  90.     0x001e,
  91.     0x007c,
  92.     0x01fc,
  93.     0x07f8,
  94.     0x1ff8,
  95.     0x01f0,
  96.     0x03f0,
  97.     0x0760,
  98.     0x0e60,
  99.     0x1c40,
  100.     0x3840,
  101.     0x7000,
  102.     0x2000,
  103.     0x0000,
  104.     };
  105.  
  106. UWORD DXC_X_cursor [16] = {
  107.   0x0000,0x700e,0x781e,0x7c3e,0x3e7c,0x1ff8,0x0ff0,0x07e0,
  108.   0x07e0,0x0ff0,0x1ff8,0x3e7c,0x7c3e,0x781e,0x700e,0x0000,
  109. };
  110.  
  111. UWORD DXC_crosshair [16] = { 
  112.   0x0280,0x0280,0x0280,0x0280,0x0280,0x0280,0xfeff,0x0000,
  113.   0xfeff,0x0280,0x0280,0x0280,0x0280,0x0280,0x0280,0x0000,
  114. };
  115.  
  116. UWORD DXC_tcross [16] = { 
  117.   0x0000,0x0100,0x0100,0x0100,0x0100,0x0100,0x0100,0x7ffc,
  118.   0x0100,0x0100,0x0100,0x0100,0x0100,0x0100,0x0000,0x0000,
  119. };
  120.  
  121. UWORD DXC_fleur [16] = { 
  122.   0x0000,0x0180,0x03c0,0x07e0,0x0180,0x1188,0x318c,0x7ffe,
  123.   0x7ffe,0x318c,0x1188,0x0180,0x07e0,0x03c0,0x0180,0x0000,
  124. };
  125.  
  126. UWORD DXC_hand2 [16] = { 
  127.   0x0000,0x7f80,0x8040,0x7e20,0x1010,0x0e10,0x1010,0x0e28,
  128.   0x1044,0x0c82,0x0304,0x0248,0x0110,0x00a0,0x0040,0x0000,
  129. };
  130.  
  131. UWORD DXC_pirate [16] = { 
  132.   0x0780,0x0fc0,0x1fe0,0x3330,0x3330,0x1fe0,0x0fc0,0x0780,
  133.   0x8784,0x8786,0x4308,0x3870,0x0780,0x1fe2,0xf03e,0x8004,
  134. };
  135.  
  136. UWORD DXC_sizing [16] = { 
  137.   0x0000,0x7f80,0x4000,0x4000,0x4000,0x47e0,0x4420,0x4422,
  138.   0x4422,0x0422,0x07e2,0x0012,0x000a,0x0006,0x01fe,0x0000,
  139. };
  140.  
  141. UWORD DXC_watch [16] = { 
  142.   0x1fe0,0x1fe0,0x1fe0,0x3ff0,0x6118,0xc10c,0xc107,0xc387,
  143.   0xc387,0xc407,0xc80c,0x6018,0x3ff0,0x1fe0,0x1fe0,0x1fe0,
  144. };
  145.  
  146. UWORD DXC_xterm [16] = { 
  147.   0x0000,0x0ee0,0x0380,0x0100,0x0100,0x0100,0x0100,0x0100,
  148.   0x0100,0x0100,0x0100,0x0100,0x0100,0x0380,0x0ee0,0x0000,
  149. };
  150.  
  151. UWORD DXC_left_ptr [] = { 
  152.   0x8000,0xc000,0xe000,0xf000,0xf800,0xfc00,0xfe00,0xff00,
  153.   0xf800,0xd800,0x8c00,0x0c00,0x0600,0x0600,0x0000,0x0000,
  154. };
  155.  
  156. UWORD DXC_circle [] = { 
  157.   0x0000,0x03c0,0x0ff0,0x1ff8,0x3c3c,0x381c,0x700e,0x700e,
  158.   0x700e,0x700e,0x381c,0x3c3c,0x1ff8,0x0ff0,0x03c0,0x0000,
  159. };
  160.  
  161. UWORD DXC_pencil [] = { 
  162.   0x0e00,0x1100,0x1180,0x0940,0x0f40,0x0420,0x0220,0x0210,
  163.   0x0110,0x0188,0x0088,0x0044,0x003c,0x001c,0x000c,0x0004,
  164. };
  165.  
  166. UWORD DXC_dotbox [] = { 
  167.   0x0000,0x0000,0x3ffc,0x2004,0x2004,0x2004,0x2004,0x2184,
  168.   0x2184,0x2004,0x2004,0x2004,0x2004,0x3ffc,0x0000,0x0000,
  169. };
  170.  
  171. UWORD DXC_hand1 [] = { 
  172.   0x0000,0x000c,0x003c,0x00f0,0x01e0,0x03c0,0x07e0,0x0ff0,
  173.   0x2fe0,0x7ff0,0x5ff0,0x07e0,0x07c0,0x4a00,0x6200,0x3400,
  174. };
  175.  
  176. UWORD DXC_icon [] = { 
  177.   0xffff,0xd555,0xaaab,0xd555,0xa00b,0xd005,0xa00b,0xd005,
  178.   0xa00b,0xd005,0xa00b,0xd005,0xaaab,0xd555,0xaaab,0xffff,
  179. };
  180.  
  181. UWORD DXC_sb_h_double_arrow [] = { 
  182.   0x0000,0x0808,0x180c,0x3ffe,0x780f,0x3ffe,0x180c,0x0808,
  183.   0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  184. };
  185.  
  186. UWORD DXC_sb_left_arrow [] = { 
  187.   0x0000,0x0800,0x1800,0x3fff,0x7800,0x3fff,0x1800,0x0800,
  188.   0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  189. };
  190.  
  191. UWORD DXC_sb_right_arrow [] = { 
  192.   0x0020,0x0030,0x7ff8,0x003c,0x7ff8,0x0030,0x0020,0x0000,
  193.   0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  194. };
  195.  
  196. UWORD DXC_sb_up_arrow [] = { 
  197.   0x1000,0x3800,0x7c00,0xfe00,0x2800,0x2800,0x2800,0x2800,
  198.   0x2800,0x2800,0x2800,0x2800,0x2800,0x2800,0x0000,0x0000,
  199. };
  200.  
  201. UWORD DXC_sb_down_arrow [] = { 
  202.   0x1400,0x1400,0x1400,0x1400,0x1400,0x1400,0x1400,0x1400,
  203.   0x1400,0x1400,0x1400,0x7f00,0x3e00,0x1c00,0x0800,0x0000,
  204. };
  205.  
  206. UWORD DXC_sb_v_double_arrow [] = { 
  207.   0x0000,0x0800,0x1c00,0x3e00,0x7f00,0x1400,0x1400,0x1400,
  208.   0x1400,0x1400,0x1400,0x1400,0x7f00,0x3e00,0x1c00,0x0800,
  209. };
  210.  
  211. UWORD DXC_top_left_arrow[] ={
  212.   0x0000,0x6000,0x7800,0x3E00,0x3F80,0x1FE0,0x1FF8,0x0F80,
  213.   0x0F80,0x0640,0x0620,0x0210,0x0208,0x0004,0x0002,0x0000
  214. };
  215.  
  216. /*#include <intuition/intuitionbase.h>*/
  217.  
  218. /*
  219. #include <graphics/gfx.h>
  220. #include <graphics/gfxbase.h>
  221. #include <graphics/gfxmacros.h>
  222. #include <graphics/displayinfo.h>
  223. #include <devices/timer.h>
  224. #include <proto/graphics.h>
  225. #include <proto/gadtools.h>
  226. #include <proto/layers.h>
  227.  
  228. #include <signal.h>
  229. #include <time.h>
  230. */
  231. #include <dos.h>
  232. #include <stdlib.h>
  233. #include <stdlib.h>
  234.  
  235. #define XLIB_ILLEGAL_ACCESS 1
  236.  
  237. #include <X11/X.h>
  238. #include <X11/Xlib.h>
  239. #include <X11/cursorfont.h>
  240. #include "amigax_proto.h"
  241. #include "amiga_x.h"
  242.  
  243. extern struct Screen *wb;
  244. extern GC amiga_gc;
  245.  
  246. #define USEPOINTERCLASS 1
  247.  
  248. Cursor prevdefined=NULL;
  249.  
  250. byte PMinvert(byte b){
  251.   byte br=(byte)(((b&128)>>7)+
  252.          ((b&64)>>5)+
  253.          ((b&32)>>3)+
  254.          ((b&16)>>1)+
  255.          ((b&8)<<1)+
  256.          ((b&4)<<3)+
  257.          ((b&2)<<5)+
  258.          ((b&1)<<7));
  259.   return(br);
  260. }
  261.  
  262. #define PWORDWIDTH    4
  263.  
  264. struct TagItem VCTags0[] =
  265. {
  266.   {VTAG_DEFSPRITERESN_GET,NULL},
  267.   {TAG_DONE, NULL},
  268. };
  269.  
  270. struct TagItem VCTags1[] =
  271. {
  272.   {VTAG_SPRITERESN_SET, SPRITERESN_35NS},
  273.   {VTAG_DEFSPRITERESN_SET, SPRITERESN_35NS},
  274.   {TAG_DONE, NULL},
  275. };
  276.  
  277. struct TagItem VCTags2[] =
  278. {
  279.   {VTAG_SPRITERESN_SET, SPRITERESN_70NS},
  280.   {TAG_DONE, NULL},
  281. };
  282.  
  283. int X11AvailCursors=10,X11NumCursors=0;
  284. typedef struct {
  285.   Pixmap pm;
  286.   VOID *pointer;
  287. } X11InternalCursor;
  288.  
  289. X11InternalCursor *X11InternalCursors=NULL;
  290.  
  291. Cursor X11FontCursors[256];
  292.  
  293. void X11init_cursors(void){
  294.   int i;
  295.   for(i=0;i<256;i++) X11FontCursors[0]=NULL;
  296.   X11InternalCursors=(X11InternalCursor*)malloc(X11AvailCursors*sizeof(X11InternalCursor));
  297.   if(!X11InternalCursors) X11resource_exit(7);
  298. }
  299.  
  300. void X11expand_cursors(void){
  301.   X11InternalCursor *old=X11InternalCursors;
  302.   X11InternalCursors=(X11InternalCursor*)malloc((X11AvailCursors+10)*sizeof(X11InternalCursor));
  303.   if(!X11InternalCursors) X11resource_exit(8);
  304.   memcpy(X11InternalCursors,old,X11AvailCursors*sizeof(X11InternalCursor));
  305.   X11AvailCursors+=10;
  306.   free(old);
  307. }
  308.  
  309. Cursor X11NewCursor(Pixmap pm,VOID *pointer){
  310.   X11InternalCursors[X11NumCursors].pm=pm;
  311.   X11InternalCursors[X11NumCursors++].pointer=pointer;
  312.   if(X11NumCursors==X11AvailCursors) X11expand_cursors();
  313.   return(X11NumCursors-1);
  314. }
  315.  
  316. void X11exit_cursors(void){
  317.   int i;
  318.   if(DG.bUse30){
  319.     for(i=0;i<X11NumCursors;i++)
  320.       if(X11InternalCursors[i].pointer!=NULL)
  321.     DisposeObject(X11InternalCursors[i].pointer);
  322.   } else {
  323.   }
  324.   free(X11InternalCursors);
  325. }
  326.  
  327. Cursor XCreatePixmapCursor(display, source, mask,
  328.                foreground_color, background_color, x, y)
  329.      Display *display;
  330.      Pixmap source;
  331.      Pixmap mask;
  332.      XColor *foreground_color;
  333.      XColor *background_color;
  334.      unsigned int x, y;
  335. {
  336.   VOID *new_pointer=NULL;
  337.   struct BitMap *bmp=NULL;
  338.   CursorData *c;
  339.   struct BitMap *bm=X11DrawablesBitmaps[X11DrawablesMap[source]].pBitMap;
  340.   int size=bm->BytesPerRow*bm->Rows,i,bpr=bm->BytesPerRow;
  341.   UWORD *data;
  342.   Pixmap pm;
  343.   
  344. #ifdef DEBUGXEMUL_ENTRY
  345.   printf("XCreatePixmapCursor %d\n",source);
  346. #endif
  347. #ifdef USEPOINTERCLASS
  348.   if(!DG.bUse30){
  349. #endif
  350.     data=(UWORD*)AllocMem(size*2+8,MEMF_CHIP|MEMF_CLEAR);
  351.     c=malloc(sizeof(CursorData));
  352.     if(!c) return(NULL);
  353.     c->size=size;
  354.     c->hotx=x;
  355.     c->hoty=y;
  356.     c->cdata=data;
  357.     if(data){
  358.       for(i=0;i<bm->Rows;i++){
  359.     *((char*)data+4+i*bpr*2)=/*PMinvert(*/(byte)*(bm->Planes[0]+i*bpr)/*)*/;
  360.     *((char*)data+4+i*bpr*2+1)=/*PMinvert(*/(byte)*(bm->Planes[0]+i*bpr+1)/*)*/;
  361.       }
  362.     }
  363.     {
  364.       Cursor new=X11NewCursor(NULL,c);
  365.       return(new);
  366.     }
  367. #ifdef USEPOINTERCLASS
  368.   }else{
  369.     int xres,yres;
  370.     VideoControl(wb->ViewPort.ColorMap,VCTags0);
  371.     if(VCTags0[0].ti_Data==POINTERXRESN_35NS){
  372.       xres=POINTERXRESN_HIRES;
  373.       yres=POINTERYRESN_HIGH;
  374.     }else{
  375.       xres=POINTERXRESN_LORES;
  376.       yres=POINTERYRESN_DEFAULT;
  377.     }
  378.     pm=XCreatePixmap(NULL,NULL,X11DrawablesBitmaps[X11DrawablesMap[source]].width,
  379.              X11DrawablesBitmaps[X11DrawablesMap[source]].height,2);
  380.     bmp=X11DrawablesBitmaps[X11DrawablesMap[pm]].pBitMap;
  381.     XCopyArea(NULL,source,pm,amiga_gc,0,0,X11DrawablesBitmaps[X11DrawablesMap[pm]].width
  382.           ,X11DrawablesBitmaps[X11DrawablesMap[pm]].height,0,0);
  383.  
  384.     new_pointer = NewObject( NULL, "pointerclass",
  385.                 POINTERA_BitMap, bmp,
  386.                 POINTERA_WordWidth, (bm->BytesPerRow)>>1,
  387.                 POINTERA_XResolution, xres,
  388.                 POINTERA_YResolution, yres,
  389.                 POINTERA_XOffset, -x,
  390.                 POINTERA_YOffset, -y,
  391.                 TAG_DONE );
  392. /*
  393.     SetWindowPointer(wb->FirstWindow,WA_Pointer,new_pointer,TAG_DONE);
  394.     getchar();*/
  395.   }
  396.   {
  397.     Cursor new=X11NewCursor(pm,new_pointer);
  398. /*    printf("XCreatePixmapCursor ok %d\n",new);*/
  399.     return(new);
  400.   }
  401. #endif
  402. }
  403.  
  404. XFreeCursor(display, cursor)
  405.      Display *display;
  406.      Cursor cursor;
  407. {
  408.   int i;
  409. #ifdef DEBUGXEMUL_ENTRY
  410.   printf("XFreeCursor %d\n",cursor);
  411. #endif
  412.   for(i=0;i<X11NumDrawablesWindows;i++){
  413.     _ActualWindow *actual=&X11ActualWindows[i];
  414.     if(actual->cursor==cursor){
  415.       XUndefineCursor(display,X11DrawablesWindowsInvMap[i]);
  416.     }
  417.   }
  418.   if(cursor!=-1){
  419. #ifdef USEPOINTERCLASS
  420.     if(!DG.bUse30){
  421. #endif
  422.       CursorData *cd=(CursorData*)X11InternalCursors[cursor].pointer;
  423.       FreeMem(cd->cdata,cd->size*2+8);
  424.       free(cd);
  425. #ifdef USEPOINTERCLASS
  426.     }else{
  427.       if(X11InternalCursors[cursor].pointer!=NULL)
  428.     DisposeObject(X11InternalCursors[cursor].pointer);
  429.       X11InternalCursors[cursor].pointer=NULL;
  430.     }
  431. #endif
  432.   }
  433. }
  434.  
  435. XUndefineCursor(display, win)
  436.      Display *display;
  437.      Window win;
  438. {
  439.   struct Window *w;
  440. #ifdef DEBUGXEMUL_ENTRY
  441.   printf("XUndefineCursor %d\n",win);
  442. #endif
  443.   if(win==(XID)0) return;
  444.   if(X11Drawables[win]==X11SUBWINDOW||X11Drawables[win]==X11WINDOW){
  445.     int parent=X11findparent(win);
  446.     w=X11DrawablesWindows[X11DrawablesMap[parent]];
  447.   }
  448.   prevwin=-1;
  449.   if(X11Drawables[win]==X11MUI){
  450.     LONG l;
  451.     extern Object *X11appwin;
  452.     get(X11appwin,MUIA_Window_Open,&l);
  453.     if(!l) return;
  454.     if(!isopen(X11DrawablesMUI[X11DrawablesMap[win]])) return;
  455.     w=_window(X11DrawablesMUI[X11DrawablesMap[win]]);
  456.   }
  457.   if(!w) return;
  458. #ifdef USEPOINTERCLASS
  459.   if(DG.bUse30) SetWindowPointer(w, TAG_DONE );
  460.   else
  461. #endif
  462.     ClearPointer(w);
  463.   prevdefined=NULL;
  464.   return(0);
  465. }
  466.  
  467. XSetCursor(Window win){
  468.   if(X11Drawables[win]==X11MUI)
  469.     XDefineCursor(NULL,win,X11DrawablesMUICursor[X11DrawablesMap[win]]);
  470. }
  471.  
  472. XDefineCursor(display, win, cursor)
  473.      Display *display;
  474.      Window win;
  475.      Cursor cursor;
  476. {
  477.   struct Window *w;
  478.   _ActualWindow *actual;
  479.   CursorData *cd;
  480. #ifdef DEBUGXEMUL_ENTRY
  481.   printf("XDefineCursor %d %d\n",win,cursor);
  482. #endif
  483.   if(cursor==-1||prevdefined==cursor) return(0);
  484.   if(!DG.bX11Cursors) return;
  485.   if(X11Drawables[win]==X11SUBWINDOW||X11Drawables[win]==X11WINDOW){
  486.     int parent=X11findparent(win);
  487.     w=X11DrawablesWindows[X11DrawablesMap[parent]];
  488.   }
  489.   prevwin=-1;
  490.   if(X11Drawables[win]==X11MUI){
  491.     LONG l;
  492.     extern Object *X11appwin;
  493.     get(X11appwin,MUIA_Window_Open,&l);
  494.     if(!l) return;
  495.     if(!isopen(X11DrawablesMUI[X11DrawablesMap[win]])) return;
  496.     w=_window(X11DrawablesMUI[X11DrawablesMap[win]]);
  497.     X11DrawablesMUICursor[X11DrawablesMap[win]]=cursor;
  498.   }
  499.   if(!w) return;
  500.  
  501.   if(X11Drawables[win]==X11WINDOW){
  502.     actual=&X11ActualWindows[X11DrawablesMap[win]];
  503.     if(!actual->mapped) {/*printf("window not mapped!\n");*/ return;}
  504.     actual->cursor=cursor;
  505.   }else if(X11Drawables[win]==X11SUBWINDOW){
  506.     actual=&X11ActualWindows[X11DrawablesMap[X11findparent(win)]];
  507.     if(!actual->mapped) {/*printf("subwindow not mapped\n");*/ return;}
  508.     actual->cursor=cursor;
  509.   }
  510.  
  511. #ifdef USEPOINTERCLASS
  512.   if(cursor!=-1&&DG.bUse30){
  513.     if(X11InternalCursors[cursor].pointer!=NULL){
  514.       SetWindowPointer(w,WA_Pointer,X11InternalCursors[cursor].pointer,TAG_DONE);
  515.     }
  516.     prevdefined=cursor;
  517. /*    printf("ok\n");*/
  518.     return;
  519.   }
  520. #endif
  521.   cd=(CursorData*)X11InternalCursors[cursor].pointer;
  522.   if(!cd) return;
  523.   if(cd->cdata){
  524.     SetPointer(w,cd->cdata,16,16,-cd->hotx,-cd->hoty);
  525.     prevdefined=cursor;
  526.     return;
  527.   } 
  528.   XUndefineCursor(display,win);
  529.   return;
  530. }
  531.  
  532. Cursor XCreateFontCursor(Display *d,unsigned int n){
  533.   int hotx,hoty;
  534.   UWORD *data=NULL;
  535. #ifdef DEBUGXEMUL_ENTRY
  536.   printf("XCreateFontCursor\n");
  537. #endif
  538.   switch(n){
  539.   case XC_ul_angle:  data=DXC_ul_angle; hotx=0;hoty=0; break;
  540.   case XC_arrow:     data=DXC_arrow; hotx=7;hoty=0; break;
  541.   case XC_right_ptr: data=DXC_right_ptr; hotx=15; hoty=0; break;
  542.   case XC_X_cursor:  data=DXC_X_cursor; hotx=7; hoty=7;break;
  543.   case XC_crosshair: data=DXC_crosshair; hotx=8; hoty=7;break;
  544.   case XC_tcross:    data=DXC_tcross; hotx=7; hoty=7;break;
  545.   case XC_fleur:     data=DXC_fleur; hotx=7; hoty=7;break;
  546.   case XC_hand2:     data=DXC_hand2; hotx=0; hoty=0;break;
  547.   case XC_pirate:    data=DXC_pirate; hotx=7; hoty=10;break;
  548.   case XC_sizing:    data=DXC_sizing; hotx=7; hoty=7;break;
  549.   case XC_watch:     data=DXC_watch; hotx=7; hoty=7;break;
  550.   case XC_xterm:     data=DXC_xterm; hotx=7; hoty=7;break;
  551.  
  552.   case XC_left_ptr:  data=DXC_left_ptr; hotx=0; hoty=0;break;
  553.   case XC_circle:    data=DXC_circle; hotx=7; hoty=7;break;
  554.   case XC_pencil:    data=DXC_pencil; hotx=12; hoty=12;break;
  555.   case XC_dotbox:    data=DXC_dotbox; hotx=8; hoty=8;break;
  556.   case XC_hand1:     data=DXC_hand1; hotx=15; hoty=0;break;
  557.   case XC_icon:      data=DXC_icon; hotx=7; hoty=7;break;
  558.   case XC_sb_h_double_arrow: data=DXC_sb_h_double_arrow; hotx=7; hoty=7;break;
  559.   case XC_sb_left_arrow:     data=DXC_sb_left_arrow; hotx=0; hoty=4;break;
  560.   case XC_sb_right_arrow:    data=DXC_sb_right_arrow; hotx=7; hoty=4;break;
  561.   case XC_sb_up_arrow:       data=DXC_sb_up_arrow; hotx=4; hoty=0;break;
  562.   case XC_sb_down_arrow:     data=DXC_sb_down_arrow; hotx=4; hoty=7;break;
  563.   case XC_sb_v_double_arrow: data=DXC_sb_v_double_arrow; hotx=7; hoty=7;break;
  564.   case XC_top_left_arrow:    data=DXC_top_left_arrow; hotx=0; hoty=0;break;
  565.   }
  566. /*
  567.   if(X11FontCursors[n]!=NULL){
  568.     return(X11FontCursors[n]);
  569.   }
  570. */
  571.   if(data){
  572.     Cursor cursor;
  573.     Pixmap pm;
  574.     struct BitMap *bmp;
  575.     pm=XCreatePixmap(NULL,NULL,16,16,1);
  576.     bmp=X11DrawablesBitmaps[X11DrawablesMap[pm]].pBitMap;
  577.     memcpy(bmp->Planes[0],data,32);
  578. /*    RectFill(&(wb->RastPort),20,20,60,60);
  579.     BltBitMapRastPort(bmp,0,0,&(wb->RastPort),22,22,16,16,0xC0);
  580.     getchar();*/
  581.     cursor=XCreatePixmapCursor(NULL,pm,NULL,NULL,NULL,hotx,hoty);
  582.     XFreePixmap(NULL,pm);
  583.     X11FontCursors[n]=cursor;
  584.     return(cursor);
  585.   }
  586.   return(-1);
  587. }
  588. Cursor XCreateGlyphCursor(display, source_font, mask_font,
  589.               source_char, mask_char, foreground_color,  background_color)
  590.      Display *display;
  591.      Font source_font, mask_font;
  592.      unsigned int source_char, mask_char;
  593.      XColor *foreground_color;
  594.      XColor *background_color;
  595. {
  596. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  597.   printf("WARNING: XCreateGlyphCursor\n");
  598. #endif
  599.   return(NULL);
  600. }
  601.  
  602. Status XIconifyWindow(display, w, screen_number)
  603.      Display *display;
  604.      Window w;
  605.      int screen_number;
  606. {
  607. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  608.   printf("WARNING: XIconifyWindow\n");
  609. #endif
  610.   return(NULL);
  611. }
  612.  
  613. XRecolorCursor(display, cursor, foreground_color,
  614.                background_color)
  615.      Display *display;
  616.      Cursor cursor;
  617.      XColor *foreground_color, *background_color;
  618. {/*'xast.o'*/
  619. #if (DEBUGXEMUL_ENTRY) || (DEBUGXEMUL_WARNING)
  620.   printf("WARNING: XRecolorCursor\n");
  621. #endif
  622.   return(0);
  623. }
  624.  
  625.